home *** CD-ROM | disk | FTP | other *** search
Text File | 1989-06-26 | 1.9 KB | 39 lines | [TEXT/GEOL] |
- Item 5666678 12-June-89 18:58
-
- From: D2605 Xanadu Operating,Marc Stiegler, PRT
-
- To: MACAPP.TECH$ MACAPP Tech
-
- Sub: Object Ordering (comparing)
-
- Alan, Chuck and John,
-
- I'm going to throw in my 2 bits on object ordering. The idea of an ordering
- operation (not EQ, or EQUAL, to use the lisp terms) for the base object type is
- a very bad one. First, there can be no general, useful, ordering between
- different types of objects. Keith pointed this out in his response. John,
- your 2nd response, where you indicated that ordering, even arbitrary, could be
- useful for lists is partially correct in that the list implementation may use
- ordering to be more efficient. If the objects have no specified ordering, that
- is, if the definition of the object does not have an ordering property, then
- ANY ordering is arbitrary. If the implementation of the list wants an
- arbitrary ordering, IT CAN IMPOSE IT! It is a property of the LIST to have
- that ordering, not the objects it contains. Therefore, the implementation that
- defines the ordering should contain the code to do the ordering.
- The ordering that is specified in Alan's first link is as easily imposed
- by the list as the object (and doesn't violate encapsulation, either).
- If you have classes which have the property of being ordered, it should be
- defined for those classes, and only type-safe comparisons between these classes
- should be allowed.
- So, keep TObject clean. Leave ordering to those objects who have it as an
- intrisic property.
- --Hugh Hoover
- Xanadu Operating Company
-
- p.s. John, re: your item 4 ... Object Pascal has no multiple-inheritence ...
- This is a significant ASSET for Object Pascal, in that multiple inheritence
- is NEVER required, and just complicates the language. But that's another
- argument :-}. Keep the language simple!
-
-
-